package com.jrx.anytxn.reporting.job.customer.step;

import com.jrx.anytxn.reporting.bean.CustomerDataBean;
import com.jrx.anytxn.reporting.service.ICustomerDataDealService;
import org.springframework.batch.item.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：lihm
 * @date ：2019/11/27 9:18
 */
@Service
public class AutoAssemCustomerWriter  implements ItemWriter<CustomerDataBean> {

    @Autowired
    private ICustomerDataDealService customerDataDealService;
    @Override
    public void write(List<? extends CustomerDataBean> items) throws Exception {
        for(CustomerDataBean customerDataBean : items) {
            customerDataDealService.saveCustomerDate(customerDataBean);
        }
    }
}
